import { request } from '@umijs/max';

/** 登录接口 POST*/
export async function loginUserAPI(body: API.LoginAPI) {
  return request<API.LoginResult>('/auth/admin_login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}

/**
 * 获取登录用户信息
 * @returns
 */
export const loadUseInfoAPI = () => {
  return request('/admin/managers/info');
};

/** 退出登录接口 POST*/
export async function outLoginAPI() {
  return request('/auth/manager_logout', {
    method: 'GET',
  });
}
